# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-lxml-html-clean
pkgver=0.3.1
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=lxml_html_clean
pkgdesc="HTML cleaner from lxml project"
url="https://pypi.python.org/project/lxml-html-clean"
arch="noarch"
license="BSD-3-Clause"
# missing py3-memory-profiler
checkdepends="py3-pytest py3-lxml"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://github.com/fedora-python/lxml_html_clean/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest -v tests.test_clean
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
db265471f4f8bbf6c35d1b24d81212b7f837954cb8c7548484235a7195f9251276bda5d1a8ad513c7a09d0853f779582606bd5d0e1576d4df0a25782dd58df9a  py3-lxml-html-clean-0.3.1.tar.gz
"
